import { GET, POST, PUT, DELETE } from '@/utils/request'

/**
 * 获取所有比赛
 * @param {Number} pageNum
 * @param {Number} paegSize
 */
export const getComps = (data) => GET('/competition', data)
/* 获取比赛信息 */
export const getComp = (id) => GET(`/competition/${ id } `, {})

/**
 * 创建新比赛信息
 */
export const postCompetition = (data) => POST('/admin/competition', data)
/**
 * 修改比赛信息
 */
export const putComp = ({ id, ...data }) => PUT(`/admin/competition/${ id }`, data)
/**
 * 删除比赛
 */
export const delCompetition = (id) => DELETE(`/admin/competition/${ id }`)
